package com.goparty.data.model;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

import com.goparty.data.constant.MessageType;

@XmlRootElement(name = "message")
@Entity
@Table(name = "gp_event_message")
public class EventMessage {
	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private String id;	
	private String message;	
	
	@Enumerated(EnumType.ORDINAL)
	private MessageType type;
	
	@OneToOne
	@JoinColumn(name = "userId")
	private User sender;
	
	private Date publishTime;
	private String eventId;
	public String getId() {
		return id;
	}
	public void setId(String id) {
		this.id = id;
	} 
	
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public MessageType getType() {
		return type;
	}
	public void setType(MessageType type) {
		this.type = type;
	}
	 
	public User getSender() {
		return sender;
	}
	public void setSender(User sender) {
		this.sender = sender;
	}
	public Date getPublishTime() {
		return publishTime;
	}
	public void setPublishTime(Date publishTime) {
		this.publishTime = publishTime;
	}
	public String getEventId() {
		return eventId;
	}
	public void setEventId(String eventId) {
		this.eventId = eventId;
	}
	
	
	
	
 
	
}
